package com.bigmi.user.controllerV1;

import com.bigmi.model.common.dtos.ResponseResult;
import com.bigmi.model.user.dtos.LoginDto;
import com.bigmi.model.user.pojos.ApUser;
import com.bigmi.model.wemedia.pojos.WmUser;
import com.bigmi.user.service.ApLoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/api/v1/login")
@Api(value = "app端用户登录",tags = "app端用户登录")
public class ApLoginController {
    @Autowired
    private ApLoginService apLoginService;



    @PostMapping("/login_auth")
    @ApiOperation("用户输入密码")
    public ResponseResult login(@RequestBody LoginDto loginDto){

        return apLoginService.login(loginDto);
    }

    @PostMapping("/get_code")
    public ResponseResult sendMsg(@RequestBody Map phone){
        return apLoginService.sendMsg(phone);
    }
    //申请成为自媒体
    @PostMapping("/apply")
    public ResponseResult apply(@RequestBody WmUser wmUser){
        return apLoginService.apply(wmUser);
    }
}
